package com.whately.core.base.constant;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class ConstantByOS {

    //上传路径非必须的
    @Value("${file.saveDir.window:}")
    private String saveDirWindows;

    @Value("${file.saveDir.linux:}")
    private String saveDirLinux;



    public  String getSaveDir(){
        String os = System.getProperty("os.name");
        if (os.toLowerCase().startsWith("win")) {  //如果是Windows系统
            return saveDirWindows;
        }else{//linux和mac系统
            return saveDirLinux;
        }
    }
}
